home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / prog_gen / xv_pc16a.zip / TABKEYS.INC < prev    next >
Text File  |  1994-04-20  |  1KB  |  48 lines

  1. {
  2. Object selection using the Tab key for the XView-PC interface
  3. By Antonio Carlos Moreirao de Queiroz - acmq@coe.ufrj.br
  4. Version 1.0 - 10/04/94
  5.  
  6. This procedure moves the mouse cursor to the next object in the active
  7. window when the Tab key is pressed, using the "interposer".
  8. The Shift-Tab key moves the cursor to the top of the next window.
  9. The Return key is equivalent to the mouse left button.
  10. To install:
  11. Include this file, and insert after "xv_init": interposer:=TabKeys;
  12. The program must use the units Mickey and XView.
  13. }
  14.  
  15. {$I extkeys.inc}
  16.  
  17. {$F+}
  18.  
  19. PROCEDURE TabKeys;
  20. VAR
  21.   pto,ptw:Xv_opaque;
  22.  
  23. BEGIN
  24.   ptw:=active_w; pto:=nil;
  25.   IF ie_code=kTab THEN BEGIN
  26.     IF active_o<>nil THEN pto:=active_o^.next
  27.     ELSE pto:=ptw^.next
  28.   END
  29.   ELSE IF ie_code=kShiftTab THEN ptw:=ptw^.under
  30.   ELSE IF ie_code=kCr THEN BEGIN
  31.     ie_code:=MS_LEFT;
  32.     Exit
  33.   END
  34.   ELSE Exit;
  35.   IF pto=nil THEN BEGIN
  36.     mousex:=ptw^.x+ptw^.dx div 2;
  37.     mousey:=ptw^.y+mrgy div 2;
  38.     open_window(ptw);
  39.   END
  40.   ELSE BEGIN
  41.     mousex:=ptw^.x+mrgx+pto^.x+pto^.dx div 2;
  42.     mousey:=ptw^.y+mrgy+pto^.y+pto^.dy div 2;
  43.   END;
  44.   mouse_move(mousex,mousey);
  45. END;
  46.  
  47. {$F-}
  48.